// Copyright (c) [Year] [name of copyright holder]
// [Software Name] is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2. 
// You may obtain a copy of Mulan PSL v2 at:
//          http://license.coscl.org.cn/MulanPSL2 
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
// See the Mulan PSL v2 for more details.

/*!
 * \autor captainpeng
 * \date 2019-10-13
 * \version 1.0
 * \copyright
 */

#ifndef MY_TYPESELECT_HPP
#define MY_TYPESELECT_HPP

#include<type_traits>

namespace my{

    // 根据条件选择类型，再编译期间决定
    template<bool flag, typename T1, typename T2>
    struct typeSelect;

    template<typename T1, typename T2>
    struct typeSelect<true, T1, T2>{
        using type = T1;
    };

    template<typename T1, typename T2>
    struct typeSelect<false, T1, T2>{
        using type = T2;
    };

}

#endif
